1. Field of the Invention
Apparatuses and methods consistent with the present invention relate to video compression encoding, and more particularly, to video prediction methods which improve compression efficiency, and apparatuses and methods for video encoding/decoding using the video prediction method.
2. Description of the Related Art
In well-known video compression standards such as moving picture expert group (MPEG)-1, MPEG-2, MPEG-4 Visual, H.261, H.263, and H.264, a picture is generally divided into macroblocks for video encoding. In the case of H.264 encoders, after each of the macroblocks is encoded in all encoding modes available in interprediction and intraprediction, bit rates required for encoding a macroblock and rate-distortion (RD) costs between the original macroblock and the decoded macroblock in the encoding modes are compared. Then, an appropriate encoding mode is selected according to the comparison result and the macroblock is encoded in the selected encoding mode.
In intraprediction, instead of referring to reference pictures in order to encode macroblocks of a current picture, a prediction value of a macroblock to be encoded is calculated using a pixel value of a pixel that is spatially adjacent to the macroblock to be encoded, and a difference between the prediction value and the pixel value is encoded.
FIG. 1 illustrates previous macroblocks used for intraprediction of a current macroblock a5 according to the prior art.
Referring to FIG. 1, previous macroblocks a1, a2, a3, and a4 are used for intraprediction of a current macroblock a5. According to a raster scan scheme, macroblocks included in a picture are scanned from left to right and from top to bottom. Thus, the previous macroblocks a1, a2, a3, and a4 are scanned and encoded before the current macroblock a5.
Because macroblocks marked with X have not been encoded, they cannot be used for predictive encoding of the current macroblock a5. Because macroblocks marked with O have low correlation with the current macroblock a5, they are not used for predictive encoding of the current macroblock a5. The previous macroblocks a1, a2, a3, and a4, which have been discrete cosine transformed and quantized, are inversely quantized and inversely discrete cosine transformed to be reconstructed.
FIG. 2 is a reference diagram for explaining adjacent pixels used in intra 4×4 modes of H.264 according to prior art.
Referring to FIG. 2, lower case letters a through p indicate pixels of a 4×4 block to be predicted, and upper case letters A through M located above and on the left side of the 4×4 block indicate neighboring samples or pixels required for intraprediction of the 4×4 block, which have been already encoded and reconstructed.
FIG. 3 illustrates intra 4×4 modes used in H.264 according to prior art.
Referring to FIG. 3, the intra 4×4 modes include a total of 9 prediction modes, i.e., a direct current (DC) mode, a vertical mode, a horizontal mode, a diagonal down-left mode, a diagonal down-right mode, a vertical left mode, a vertical right mode, a horizontal up mode, and a horizontal down mode. In the intra 4×4 modes, pixel values of pixels a through p are predicted from pixels A through M of adjacent macroblocks. The compression efficiency of encoders varies with an encoding mode selected for intraprediction. To select the optimal encoding mode, prediction of a block is performed in all possible encoding modes, costs are calculated using a predetermined cost function for the encoding modes, and an encoding mode having the smallest cost is selected for encoding.
However, there still is a need for an encoding method capable of improving compression efficiency to provide high-quality video to users.